<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>测试---项目---智能办公系统</title>
    <!-- 引入样式 -->
    <link rel="stylesheet" th:href="@{/static/css/theme-chalk.css}">

    <link rel="stylesheet" th:href="@{/static/css/awe.css}">

    <link rel="stylesheet" th:href="@{/static/css/index.css}" />

    <link rel="shortcut icon" th:href="@{/static/icon/favicon.ico}" />
    <link rel="bookmark"  th:href="@{/static/icon/favicon.ico}"  />

    <style  type="text/css">
        [v-cloak] {
            display: none;
        }
    </style>

</head>
<body>
    <div id="app"  v-cloak>
        <el-container>

 <!-- 添加侧边栏 -->
  <div id="menu-form-div"  ></div>

            <el-container>

<!-- 添加头部 -->
<div id="head-form-div"  ></div>

                <!-- 主要内容区域 -->
                <el-main>
                    <div class="container">


 <!-- 查询模块 -->
<div id="query-form-div"  ></div>
<!-- 表格 -->
<div id="table-form-div"  ></div>



<!--  foot-->
 <div id="foot-form-div"  ></div>

 <!-- 对话框 -->
<div id="dialog-form-div"  ></div>



                    </div>
                </el-main>
            </el-container>
        </el-container>
    </div>


    <!-- 引入 Vue -->
    <script th:src="@{/static/js/vue.js}"></script>
    <!-- 引入 ElementUI -->
    <script th:src="@{/static/js/element-ui.js}"></script>
    <!-- 引入 ECharts -->
    <script th:src="@{/static/js/echarts.common.min.js}"></script>
    <!-- 引入 Moment.js -->
    <script th:src="@{/static/js/moment.js}"></script>
    <!-- 引入 Axios -->
    <script th:src="@{/static/js/axios.js}"></script>

    <script th:src="@{/static/js/const.js}"></script>

    <script th:src="@{/static/js/tool.js}"></script>

    <script th:src="@{/static/js/axi.js}"></script>

    <script th:src="@{/static/js/app/project/code/vue/vuewz.js}"></script>
    <script th:src="@{/static/js/app/project/code/vue/vuemethod.js}"></script>

    <script th:inline="text">
            function gogogo() {
                new Vue({
                    el: '#app',
                    data() {
                        const complex = {
                            pre: '[[${pre}]]',
                            a: '[[${a}]]',
                            b: '[[${b}]]',
                            c: '[[${c}]]',
                            tokenJson: '',
                            tokenObject: '[[${tokenObject}]]',
                            sysinfoMicroId: '[[${sysinfoMicroId}]]',
                            //
                            abc: {
                                micro: {} ,  // 微服务
                                module: {},  // 模块
                                entity: {},  // 实体
                            },
                            queryinfo: {
                                name1: '无限制',    // 微服务名称   （选中）
                                name2: '字典值'     // 字典类型     （选中）
                            },

                            //
                            dictinfo: {
                                micro0: {
                                    tag: '0:micro:#',
                                    list: []
                                },

                                dict_type0: {
                                    tag: '0:dict_type:#',
                                    list: [],
                                    name: '字典值'
                                }
                            },

                            sels: [],

                        }
                        return Object.assign(complex, vuewz)
                    },
                    computed: {
                        completedTodos() {

                        }
                    },
                    watch: {
                        'formData.typeDictId': {
                            handler(newValues) {
                                this.formData.type = this.dictinfo.dict_type0.list.filter(item => item.id == newValues)[0].code
                            },
                            deep: false,
                            immediate: false
                        },
                        'searchForm.typeDictId': {
                            handler(newValues) {
                                this.queryinfo.name2 = this.dictinfo.dict_type0.list.filter(item => item.id == newValues)[0].name
                                //
                                this.loadTableData()
                            },
                            deep: false,
                            immediate: false
                        },
                        'searchForm.sysinfoMicroId': {
                            handler(newValues) {
                                this.queryinfo.name1 = this.dictinfo.micro0.list.filter(item => item.id == newValues)[0].name
                                //
                                this.loadTableData()
                            },
                            deep: false,
                            immediate: false
                        },
                    },
                    methods: Object.assign({}, vuemethod, {

                        // methods
                        handleSelectionChangeTable(val) {
                            this.sels = val
                        }

                    }),
                    mounted() {
                        this.loadToken()
                        this.loadTableData()
                        this.loadMenus()
                        this.loadRole()
                        //
                        axi.get(this,  '/auth/sysinfo/menu' + '/abc'  , { a: this.a, b: this.b, c: this.c },  data => {
                            if (data) {
                                this.abc = data
                                //
                                this.activeMenu = this.abc.entity.flag
                                this.openMenu = [this.abc.module.flag]
                            }
                        })
                        //
                        const tagValues = []
                        for (const [, value] of Object.entries(this.dictinfo)) {
                            tagValues.push(value.tag)
                        }
                        const codes = tagValues.join(';')
                        axi.get(this,  '/project/test/dict' + '/batch'  , { codes: codes },  data => {
                            if (data) {
                                Object.keys(data).forEach(key => {
                                    const value = data[key]
                                    this.dictinfo[key].list = value
                                })
                                //
                                this.searchForm.type = this.dictinfo['dict_type0'].list[0].id
                                this.dictinfo['micro0'].list  = [...[{id: 0, name: '无限制'}], ...this.dictinfo['micro0'].list]

                            }
                        })



                    }
                })
            }

            //
            async  function loadHtmlContent(parts) {
                for (let i = 0; i < parts.length; i++) {
                    const res = await axios.get('[[${pre}]]/html/[[${a}]]/[[${b}]]/[[${c}]]/' + parts[i]  + '/[[${token}]]?t=1741040995598&sysinfoMicroId=[[${sysinfoMicroId}]]' + "&page=" + parts[i])
                    window.document.getElementById(parts[i] + '-form-div').outerHTML = res.data
                }
            }
            // 创建一个 axios 实例
            (async () => {
                const parts = vuewz.parts
                await loadHtmlContent(parts)
                // 调用 gogogo 函数
                gogogo()
            })()


    </script>
</body>
</html>

